# 模块的内容
import copy
import pprint

# 使用dir查看
pprint.pprint([n for n in dir(copy) if not n.startswith('_')])
# ['Error', 'copy', 'deepcopy', 'dispatch_table', 'error']

# all 完整列表
pprint.pprint(copy.__all__)  # ['Error', 'copy', 'deepcopy']
# __all__ = ["Error", "copy", "deepcopy"] 源码中这样使用

# 使用 from copy import * 时导入就是all中的内容


# help 查看用法
help(copy.copy)
# Help on function copy in module copy:
#
# copy(x)
#     Shallow copy operation on arbitrary Python objects.
#
#     See the module's __doc__ string for more info.
#

# doc文档
print()
print(copy.copy.__doc__)
# Shallow copy operation on arbitrary Python objects.
#
#     See the module's __doc__ string for more info.

print(range.__doc__)
# range(stop) -> range object
# range(start, stop[, step]) -> range object
#
# Return an object that produces a sequence of integers from start (inclusive)
# to stop (exclusive) by step.  range(i, j) produces i, i+1, i+2, ..., j-1.
# start defaults to 0, and stop is omitted!  range(4) produces 0, 1, 2, 3.
# These are exactly the valid indices for a list of 4 elements.
# When step is given, it specifies the increment (or decrement).


# __file__源码位置
print()
print(copy.__file__)  # D:\Program Files\pythons\python311\Lib\copy.py
